Skip to content

Commit 8538736

Browse files
authored
Add detection of Pi400 computer
1 parent 5e948d5 commit 8538736

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

app/server/ruby/lib/sonicpi/util.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ module Util
7171
@@raspberry_pi_4_4gb_64 = RUBY_PLATFORM.match(/aarch64.*-linux.*/) && ['c03111','c03112'].include?(`awk '/^Revision/ { print $3}' /proc/cpuinfo`.delete!("\n"))
7272
@@raspberry_pi_4_8gb_64 = RUBY_PLATFORM.match(/aarch64.*linux.*/) && ['d03114'].include?(`awk '/^Revision/ { print $3}' /proc/cpuinfo`.delete!("\n"))
7373
@@home_dir = File.expand_path((ENV['SONIC_PI_HOME'] || @@user_dir) + '/.sonic-pi/')
74+
@@raspberry_pi_400 = RUBY_PLATFORM.match(/.*arm.*-linux.*/) && ['c03130'].include?(`awk '/^Revision/ { print $3}' /proc/cpuinfo`.delete!("\n"))
75+
@@raspberry_pi_400_64 = RUBY_PLATFORM.match(/aarch64.*linux.*/) && ['c03130'].include?(`awk '/^Revision/ { print $3}' /proc/cpuinfo`.delete!("\n"))
7476
@@project_path = @@home_dir + '/store/default/'
7577
@@log_path = @@home_dir + '/log'
7678

@@ -172,7 +174,15 @@ def raspberry_pi_4_8gb_64?
172174
os == :raspberry && @@raspberry_pi_4_8gb_64
173175
end
174176

175-
def unify_tilde_dir(path)
177+
def raspberry_pi_400?
178+
os == :raspberry && @@raspberry_pi_400
179+
end
180+
181+
def raspberry_pi_400_64?
182+
os == :raspberry && @@raspberry_pi_40_64
183+
end
184+
185+
def unify_tilde_dir(path)
176186
if os == :windows
177187
path
178188
else
@@ -232,7 +242,11 @@ def host_platform_desc
232242
"Raspberry Pi 4B:4Gb 64bit OS"
233243
elsif raspberry_pi_4_8gb_64?
234244
"Raspberry Pi 4B:8Gb 64bit OS"
235-
else
245+
elsif raspberry_pi_400?
246+
"Raspberry Pi 400:4Gb"
247+
elsif raspberry_pi_400_64?
248+
"Raspberry Pi 400:4Gb 64bit OS"
249+
else
236250
"Raspberry Pi"
237251
end
238252
when :linux

0 commit comments

Comments
 (0)